1. Technical Field
The present invention relates to a method and system for data processing in general and, in particular, to a method and system for processing non-native instructions within a computer system. Still more particularly, the present invention relates to an improved method and system for translating non-native instructions to instructions native to a processor within a computer system.
2. Description of the Prior Art
The World Wide Web, or as it is simply known, the "Web," has dramatically changed the online world and continues to grow in popularity. As a communications system, the Web allows information providers to distribute and collect information globally arid instantly. For users, the Web is a dynamic view into the works and ideas of millions of people worldwide. Through a system of hypertext, users of the Web are able to select and view information from all over the Web. While the hypertext system gives Web users a high degree of selectivity over the information they choose to view, their level of interactivity with that information is low. Even with improvements such as hypermedia, which opens up many new kinds of sensory input for the Web users, including access to graphics and videos, the Web itself still lacks a true interactivity-- the kind of real-time, dynamic, and visual interaction between Web users and applications.
Java.sup.1 brings this missing interactivity to the Web. With Java, animations and interactive applications on the Web become feasible. Java's features enrich communication, information, and interaction on the Web by enabling the distribution of executable content--rather than just Hypertext Markup Language (HTML) pages and hypermedia files--among Web users. This ability to distribute executable content is one of the powerful features of Java. FNT .sup.1 Java is a trademark of Sun Microsystems, and is also the name of a programming language developed by Sun Microsystems.
In order to view and interact with the animation and the interactive applications on the Web, a Web user must have a computer installed with a Java-enabled Web browser. Even so, because Java has an instruction set that is different from the instruction set of most, if not all, processors utilized within a Web user's personal computer, Java instructions typically cannot be executed in theirs original bytecode form. Hence, some form of translation from the Java instruction set to an instruction set associated with the processor within the personal computer is required. Conventionally, an instruction set associated with a particular processor is called a "native" instruction set to that computer, while an instruction set that is not specifically developed for that particular processor is called a "non-native" instruction set to that particular computer. In this case, Java would be a non-native instruction set with respective to the Web user's computer.
There are two commonly used methods to execute a non-native instruction set within a computer. The first method is to utilize a software interpreter. This method is very easy to implement, but it has poor performance due to the large amount of overhead that the software interpreter requires for the execution of each non-native instruction. The second method is to compile the program that is in non-native instructions to a set of native instructions. However, this method requires a large amount of memory for storing the compiler as well as the output of the compiler. Furthermore, if the application is not available until it is invoked, the initial compilation time may add a significant delay before the execution even begins. Hence, both of these methods inevitably result in performance degradation.
A better method would require a hardware element that translates non-native instructions to native instructions in "real time." The term "real time" in this case means that the native instructions are generated from the non-native instructions as soon as the processor within the computer attempts to perform an instruction fetch from a system memory. The present disclosure describes such a hardware element for efficiently performing the translation of non-native Java instructions to instructions that are native to the processor within the computer.